package com.sgb.capital.view.ui.adapter;

import android.graphics.Typeface;
import android.widget.TextView;

import com.sgb.capital.R;
import com.sgb.capital.model.BusinessInfoBean;
import com.sgb.capital.utils.Utils;
import com.sgb.capital.view.widget.BaseRecyclerViewAdapterHelper.BaseQuickAdapter;
import com.sgb.capital.view.widget.BaseRecyclerViewAdapterHelper.viewholder.BaseViewHolder;

import java.util.List;

/**
 * 作者:张磊
 * 日期:2021/4/16 0016
 * 说明:选择银行卡
 */
public class DataEnterpriseAdapter extends BaseQuickAdapter<BusinessInfoBean, BaseViewHolder> {


    public DataEnterpriseAdapter(List<BusinessInfoBean> beans) {
        super(R.layout.data_adapter, beans);
    }

    @Override
    protected void convert(BaseViewHolder helper, final BusinessInfoBean item) {
        helper.setText(R.id.tv_name, item.payeeCompanyName)
                .setTextColor(R.id.tv_name, Utils.getColor(item.isSelect ? R.color.color_000000 : R.color.color_666666))
                .setVisible(R.id.iv_sel, item.isSelect);
        TextView tv_name = helper.getView(R.id.tv_name);
        tv_name.setTypeface(item.isSelect ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
    }
}